package com.qhhc.hospital.service.impl;

import com.qhhc.hospital.entity.DoctorUser;
import com.qhhc.hospital.mapper.DoctorUserMapper;
import com.qhhc.hospital.service.IDoctorUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorUserService implements IDoctorUserService {
    @Autowired
    DoctorUserMapper doctorUserMapper;
    
    @Override
    public int insert(DoctorUser doctorUser) {
        int count = doctorUserMapper.insertDoctorUser(doctorUser);
        return count;
    }
    
    @Override
    public List<DoctorUser> selectAll() {
        List<DoctorUser> doctorUsers = doctorUserMapper.selectAllDoctorUsers();
        return doctorUsers;
    }
    
    @Override
    public DoctorUser selectById(Integer dId) {
        DoctorUser doctorUser = doctorUserMapper.selectDoctorUserById(dId);
        return doctorUser;
    }
    
    @Override
    public List<DoctorUser> selectBySection(String dSection) {
        List<DoctorUser> doctorUsers = doctorUserMapper.selectDoctorUserBySection(dSection);
        return doctorUsers;
    }
    
    @Override
    public int update(DoctorUser doctorUser) {
        return doctorUserMapper.updateDoctorUser(doctorUser);
    }
    
    @Override
    public int delete(Integer dId) {
        return doctorUserMapper.deleteDoctorUser(dId);
    }
} 